//
//  UIs_UILabelFitWidth_DemoVC.swift
//  APSwift
//
//  Created by jianbo.pei on 2022/5/20.
//

import UIKit
import APExtensions
//import JKSwiftExtension

class UIs_UILabelFitWidth_DemoVC: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        let lb = UILabel.ap.lb(.systemFont(ofSize: 18), .purple)
        view.addSubview(lb)
        lb.frame = CGRect(x: 50, y: 100, width: ap_kScreenW - 100, height: 50)
        lb.backgroundColor = .lightGray
        lb.text = "【未自适应】UILabel指定宽度时，文字太长的话会自动变小测试用！"
        
        var lb1 = UILabel()
        view.addSubview(lb1)
        /// 如果导入`import JKSwiftExtension`，会报以下错：
        /// Ambiguous use of 'font'
        lb1.font(.systemFont(ofSize: 18)).textColor(.purple)
        lb1.frame = CGRect(x: 50, y: 200, width: ap_kScreenW - 100, height: 50)
        lb1.backgroundColor = .lightGray
        lb1.text = "【自适应】UILabel指定宽度时，文字太长的话会自动变小测试用！"
        lb1.ap.adjustsToFitWith = true
        
    }



}
